var fs = require("fs");
let join = require('path').join;

module.exports= {
    findSync :function (startPath) {
        let result = [];

        function finder(path) {
            let files = fs.readdirSync(path);
            files.forEach((val, index) => {
                let fPath = join(path, val);
                let stats = fs.statSync(fPath);

                if (stats.isDirectory()) {
                    finder(fPath);
                }
                else if (stats.isFile()) {
                    result.push(fPath);
                }

            });

        }

        finder(startPath);
        return result;
    }
}

